package com.ado.bazinga.core.utils;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;
import java.util.Random;

/**
 *@author adonais
 *@date 2020年3月24日
 *@description IDUtils.java
 **/
public final class IDUtils {


	/**
	 * 生成订单id方法
	 * @return
	 */
	public static String generatorId() {
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd") ;
		String str = simpleDateFormat.format(new Date());
		Random random=new Random();
		int randNum= (int)(random.nextDouble()*(99999-10000 + 1))+ 10000;
		StringBuffer stringBuffer = new StringBuffer();
		stringBuffer.append("R");
		stringBuffer.append(str);
		stringBuffer.append(randNum);
		return stringBuffer.toString() ;

	}


}
